package com.ruoyi.biz.service.impl;

import com.ruoyi.biz.entity.LotteryUserDO;
import com.ruoyi.biz.mapper.LotteryUserDAO;
import com.ruoyi.biz.service.LotteryUserService;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class LotteryUserLotteryUserServiceImpl implements LotteryUserService {

    @Resource
    LotteryUserDAO lotteryUserDAO;

    @Override
    public List<LotteryUserDO> queryList(LotteryUserDO lotteryUserDO) {
        return lotteryUserDAO.queryList(lotteryUserDO);
    }

    @Override
    public int insert(LotteryUserDO lotteryUserDO) {
        lotteryUserDO.setLotteryUserId(IdUtils.simpleUUID().toUpperCase());
        lotteryUserDO.setUpdtTime(new Date());
        return lotteryUserDAO.insert(lotteryUserDO);
    }

    @Override
    public int updateLotteryUser(LotteryUserDO lotteryUserDO) {
        return lotteryUserDAO.update(lotteryUserDO);
    }

    @Override
    public int deleteLotteryUser(String ids) {
        LotteryUserDO lotteryUserDO = new LotteryUserDO();
        lotteryUserDO.setLotteryUserId(ids);
        lotteryUserDO.setValiFlag("0");
        lotteryUserDO.setUpdtTime(new Date());
        return lotteryUserDAO.update(lotteryUserDO);
    }
}
